﻿using System;

namespace OfficeMiddlewareCore
{
    public class LogHelper
    {
        /// <summary>
        /// 普通日志
        /// </summary>
        /// <param name="message">日志内容</param>
        public static void Info(string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("loginfo");
            if (log.IsInfoEnabled)
            {
                log.Info(message);
            }
            log = null;
        }
        /// <summary>
        /// 错误日志
        /// </summary>
        /// <param name="message">错误日志</param>
        public static void Error(string message,Exception exception=null)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("logerror");
            if (log.IsInfoEnabled)
            {
                log.Error(message, exception);
            }
            log = null;
        }
    }
}
